Release 10.1A: OpenEdge Development:
Progress Dynamics Advanced Development
Creating a custom super procedure for the browser
Next, you must activate the custom super procedure that extends the browser class. Copy the file
src/adm2/custom/browsercustom.ito a local directory with the same relative pathname, and edit it to remove the comments around thestart-super-procstatement that startsbrowsercustom.p, as shown:
Add the supporting code for the pop-up menu. Copy the file
src/adm2/custom/browsercustom.pto a local directory with the same relative path. The remainder of this section highlights key parts of the code that must be added to the super procedure. A complete version of the code is available in thebrowsercustom_popup.pfile that accompanies this documentation. You can refer to this procedure for more code details and run it (after renaming it, of course) to try out the feature.The first requirement is that there must be functions that support getting and setting the two new properties you just defined. As we noted, the
xppreprocessors you defined allow code within the super procedure itself, or in other super procedures in the browser support code, to access the property directly in the property temp-table record for the object. This is done using the{get}and{set}include files that you’ve seen elsewhere in this documentation. The include files access the property without using a function call, which is a small optimization.But other objects cannot use this convention because they do not have access to the temp-table record directly. So you must define
getandsetfunctions for every property that should be retrievable or settable from outside the object itself and its supporting code.The form of these functions is simple. The following code sample is the get function for the
BrowsePopupActiveproperty:
As you can see, it simply turns around and accesses the property via the
{get}include file, which is available to it because it is within the class hierarchy for the object, where the include files can be used. Thesetproperty function is similar, as shown:
You need equivalent functions for the
BrowseColumnsMovableproperty as well.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |